<?php

	/**
	* @author Robbie Vasquez
 	* @author Matt Kennedy
 	*/
	
	class Sessions extends Model
	{
		
		public function Sessions()
		{
			// Call the model constructor
			parent::Model();
			
			$this->load->database();
					
		}
		
		//creating function for user to log in
		public function logged_in()
		{
			//session check
			session_start();
			
			if(@$_SESSION['auth'] != "yes")
			{
				session_destroy();
				unset($_SESSION);
				
				header("Location: /runningrecords/");
				exit();
			}
		}
		
	}	
